UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '92IUxbXQQtT95CzaUg9gwiotmKVw8z354Sfa1Yrija4=' 
WHERE 
  key_id = '64170c8aa312fc2541094fb0ca5845c01e334d3331e1080e0af7728d62a8ae87' 
  AND (
    token = '92IUxbXQQtT95CzaUg9gwiotmKVw8z354Sfa1Yrija4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052