UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1G8EcffctnSpeXiKNm74gQrHO3uB7lHKD8DT2MnaB/E=' 
WHERE 
  key_id = '4b9179a257ba1a9a405f7c18ae631a6c2b051a575023733dc23bada6ca0d3bed' 
  AND (
    token = '1G8EcffctnSpeXiKNm74gQrHO3uB7lHKD8DT2MnaB/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030