UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nUpnzKFDrbKipX/srUXn6wCmwxKysN8bKy77CY1cP0g=' 
WHERE 
  key_id = '2767f663339ff97e3ac81d9ded31179bda9aaf1b0206dff6ceb5867803127ebf' 
  AND (
    token = 'nUpnzKFDrbKipX/srUXn6wCmwxKysN8bKy77CY1cP0g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036