UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k6Qua5YWYZAZ71steJM9v/ZbUGwaeq95zCjtujdj6AA='
WHERE
key_id = 'e24790a66846a15d67f368df635e39bcbb958a7b66fcbd7eb9d5b2600baab29a'
AND (
token = 'k6Qua5YWYZAZ71steJM9v/ZbUGwaeq95zCjtujdj6AA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)