UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CWO/BhLoSIw23WyNLNrl/w5qfYu3In40pr21rdhK89g='
WHERE
key_id = 'd5466a15d14096a6a9714d5fa0b2c0917d89ffae72f2d7ed46f89c022586d2f8'
AND (
token = 'CWO/BhLoSIw23WyNLNrl/w5qfYu3In40pr21rdhK89g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)