UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '64O/HV4hBI+s45b7Mr5wYZ4EZ5oJuQ4ED4MT4AfSh4s='
WHERE
key_id = 'd70cd78a8b5b0241a912318d5d9a4edab42d0bb1cf04a56ad492be05080b3344'
AND (
token = '64O/HV4hBI+s45b7Mr5wYZ4EZ5oJuQ4ED4MT4AfSh4s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)