UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y/xcOG98FCPTKW65SYdoqsNwiaUSTQoIXZqRqbR6WOc='
WHERE
key_id = 'bdaa7fa490cc344dc31f3636b37badaa1dd30736b3e03ba336e4cbf842a2a9fd'
AND (
token = 'Y/xcOG98FCPTKW65SYdoqsNwiaUSTQoIXZqRqbR6WOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)