UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TUof8pzoIU/O/Z7v8vu/5J4kqY11NPtqnvEEMbRQr6M='
WHERE
key_id = '1bea7782c5f795e83404836bb1dcfc0b377d8ca54513b5d46b83bf213d990988'
AND (
token = 'TUof8pzoIU/O/Z7v8vu/5J4kqY11NPtqnvEEMbRQr6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)