UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8UV7XwtA81Ex7ZPCr968gB9S997pkdfAEf+ck/Mphf4='
WHERE
key_id = 'f19ecb8249c7471ab7e176f67d5f1c31df3eb59547fd45c02f6c93e6f396384c'
AND (
token = '8UV7XwtA81Ex7ZPCr968gB9S997pkdfAEf+ck/Mphf4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)