UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'st5zv6hhf4J0oM4TJbpgCQuZA1cgn5A8Sfxo8qG9xfU='
WHERE
key_id = '168efdafb8acc2b971ed9f213f031d211d3236c8ef2521ccd3965414287eb18c'
AND (
token = 'st5zv6hhf4J0oM4TJbpgCQuZA1cgn5A8Sfxo8qG9xfU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)