UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'seNhPDTTdi49aiHGKQWtzYiZ0mHrF2cc5z+LlUk7f90='
WHERE
key_id = 'badec3dc063d807afb306e7c5364ff4da45efa82cd5197ffc69543425c71cf7b'
AND (
token = 'seNhPDTTdi49aiHGKQWtzYiZ0mHrF2cc5z+LlUk7f90='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)