UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fn4lasvYRy7B30Lw8UrQxYLw9FB1wVoqadujOMA3oXk='
WHERE
key_id = '7f21f3955dc518f8cc93d4fa055c99e8704a28e0a0b511e6d615bf8685c76949'
AND (
token = 'fn4lasvYRy7B30Lw8UrQxYLw9FB1wVoqadujOMA3oXk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)