UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AxE2tXH5rj3A3tHJ/3XuLHDwNKSaZ8h2y8+hKsIGsgo=' 
WHERE 
  key_id = '4c5d5f2856c38c3ba4fafa9152e479ed4d0f1b0e71e35b8a188752230371ce79' 
  AND (
    token = 'AxE2tXH5rj3A3tHJ/3XuLHDwNKSaZ8h2y8+hKsIGsgo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050