UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3PmKV5VRb1hEi2b599YWa564Tx0KJE+BJC2wZgR38H8='
WHERE
key_id = '637bb690a022181ad60f8565099b0a7429ea4297e96cbc6bf694f85c4b534083'
AND (
token = '3PmKV5VRb1hEi2b599YWa564Tx0KJE+BJC2wZgR38H8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)