UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '18PekGjG0G/s8wJIu2c/UPhc10dN1Gn+5YPW7QiFdGg='
WHERE
key_id = '034ee4a36e5f3f42a27ad2b5a48f70c29f880b4b343c1b23a01e8cbff0ca45b6'
AND (
token = '18PekGjG0G/s8wJIu2c/UPhc10dN1Gn+5YPW7QiFdGg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)