UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ctkgkiXZmOEMNdEFXIeNfSwoxgrcHcRqChdHGPq486M='
WHERE
key_id = 'aaf75eb23b97a19e59f680f680553cbc88aa62d6cb01646c63618705fd3bbd71'
AND (
token = 'ctkgkiXZmOEMNdEFXIeNfSwoxgrcHcRqChdHGPq486M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)