UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0vdI3Cy/i0cVKVIKBdTxNJX/7+DsSVy/4f+j5vbAWK4='
WHERE
key_id = '5cd012692f562121de1325293d13db14aee6ebc589ff197c18a55caf7a0a3173'
AND (
token = '0vdI3Cy/i0cVKVIKBdTxNJX/7+DsSVy/4f+j5vbAWK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)