UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WIqpgfz4elNQRIAy4j/tHJBPAdQLaHOP7bNNpNSV3tI='
WHERE
key_id = '0d6c5b5f6b4aa5acddcdf826ee230f45e948a2a5f0834cf616f86794aff509dc'
AND (
token = 'WIqpgfz4elNQRIAy4j/tHJBPAdQLaHOP7bNNpNSV3tI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)