UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jey23nCOdLh5stwwEoomg1jr28KehOoVXWHMtC/V0RQ='
WHERE
key_id = 'db1f7c470c624e8249a696b4de7e031e60dd5becd25d9dd30dd8fa87a6f4221b'
AND (
token = 'jey23nCOdLh5stwwEoomg1jr28KehOoVXWHMtC/V0RQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)