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