UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+kiS2NLByycnlnoePXQ+d0EmlpJU9C+d3ixHcBHME9k=' 
WHERE 
  key_id = 'a04f4e43873374e11ae1e41c37b3a93ed574cede97ec35c8d6324aba5bef99af' 
  AND (
    token = '+kiS2NLByycnlnoePXQ+d0EmlpJU9C+d3ixHcBHME9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034