UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0yiSv497Eb15e7nhybD00IbiHI0JkxnuntDGMqizQWA='
WHERE
key_id = 'bd82636f37c35e2d077b4b5ca7b2400f092c324aba5223034e5712e8ad742b69'
AND (
token = '0yiSv497Eb15e7nhybD00IbiHI0JkxnuntDGMqizQWA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)