UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'svdMbtDwmYGa5b78MeZ6gH9mnqrTjAxMvIT2RdxYe9E='
WHERE
key_id = 'c47adbf7c0479b94ec80a3044e155ac563fc29f8ce6446cb6e14983e76349cc6'
AND (
token = 'svdMbtDwmYGa5b78MeZ6gH9mnqrTjAxMvIT2RdxYe9E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)