UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RDrSXTxbJrhifB2uVa1ZDr2ikUcSx7ICJ/HIIO7G7Ys='
WHERE
key_id = 'f64f740eaaa6ccd061798177e819b1e8ffcbe05f1eb70c1ba1e28d063528a39b'
AND (
token = 'RDrSXTxbJrhifB2uVa1ZDr2ikUcSx7ICJ/HIIO7G7Ys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)