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