UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wkE6/iKqr468/15vP4u6K1PGvT4VQGgtqIkEiMWa9Eo='
WHERE
key_id = '7f3f02e2486130a964eb866009cd8ec56362366a115e5c4187827a6d302c5694'
AND (
token = 'wkE6/iKqr468/15vP4u6K1PGvT4VQGgtqIkEiMWa9Eo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)