UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WVHSFHnuebtki4FT9zUh3WjSzkNRI5d52KuaPyraY/o=' 
WHERE 
  key_id = 'b835744cd1b9abf4da3fffb78cc56c9a0af0f4d2b28236e8b76ccda787421c4c' 
  AND (
    token = 'WVHSFHnuebtki4FT9zUh3WjSzkNRI5d52KuaPyraY/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038