UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XF84PADjkv7NQqIVi47Eji8ZF9sx41CxFiWE5Jfg25k='
WHERE
key_id = '6e1f3d1e1b3a96f21b961f64fd29e00220dba6c9a95c40bc288f576f7b6f0dc6'
AND (
token = 'XF84PADjkv7NQqIVi47Eji8ZF9sx41CxFiWE5Jfg25k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)