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