UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HPpGFQ7C152ayVbaGRhxZl7NFwRgGN8DtgVsocyzmJs=' 
WHERE 
  key_id = '01ab871ca940ef54935e34db1c81ea6f94fadcb9a88d6c1ed9e35ac6324c07f4' 
  AND (
    token = 'HPpGFQ7C152ayVbaGRhxZl7NFwRgGN8DtgVsocyzmJs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037