UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FUpMWjhrMMLD06lp/Q8W1NdAmXOpSg/AxkW9I+Hg8jo='
WHERE
key_id = 'cf979d6661a7432eca4998b1d0eb6cc223b7d57b69c5d1b5725577809dd62401'
AND (
token = 'FUpMWjhrMMLD06lp/Q8W1NdAmXOpSg/AxkW9I+Hg8jo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)