UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RaG3SC/9Xu/GWFr9Z49wVcMn8wYAf28oQVYG31ImzjA='
WHERE
key_id = '9a607b776bc4c61a4901371e10ec9730a09271489be67177eef754766db6a839'
AND (
token = 'RaG3SC/9Xu/GWFr9Z49wVcMn8wYAf28oQVYG31ImzjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)