UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3hZyzZwZ1guKuodWaCSdxxCP3hUEFQZ2QoCCxo6yYtM='
WHERE
key_id = '01a36a2786a83cb2e0442290f0ac3547ed015f7329bf860abace6dc1352ad654'
AND (
token = '3hZyzZwZ1guKuodWaCSdxxCP3hUEFQZ2QoCCxo6yYtM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)