UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zSJGotJtrNN7coh0om7pS4w63Htc2cgi0eh+JUF1HAU='
WHERE
key_id = 'c645f4656b0983732519d2c523c544cefeeb21a2f4202a4adc0637a2b7f750a3'
AND (
token = 'zSJGotJtrNN7coh0om7pS4w63Htc2cgi0eh+JUF1HAU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)