UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'feMK3kQpkcWlGljw4h0JV/u5AguoShP9FMn85XV4IQ8='
WHERE
key_id = 'cd80ff9b7415255095d81be98841e3647d764a9d3a3f9a335211c2f783a3d010'
AND (
token = 'feMK3kQpkcWlGljw4h0JV/u5AguoShP9FMn85XV4IQ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)