UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eF8IkbqNso7pvYD4U9DB/ACOseK8Z4TNv23ZRjZdyj4='
WHERE
key_id = 'd7997bc67ab9138cf0116f969ddfab673c664f979f4da3cd34fcf176d02fd095'
AND (
token = 'eF8IkbqNso7pvYD4U9DB/ACOseK8Z4TNv23ZRjZdyj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)