UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OXXrZk4q1ayLeFedHrM37l7K8gZtJMfw/7X1RTA8c0M='
WHERE
key_id = 'd2fa98429f685ef1a6b2e2f64653341737ca22de1a1510621b6c10f81a25f57c'
AND (
token = 'OXXrZk4q1ayLeFedHrM37l7K8gZtJMfw/7X1RTA8c0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)