UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MvYssIZRu6SIX3fKHwMFTo/lLWKx2znKgsRdPcK9o1E=' 
WHERE 
  key_id = 'ce202b5d843be84b4d7094e40cffa22d78e044bca69d1f45a782893a6ff7ffe7' 
  AND (
    token = 'MvYssIZRu6SIX3fKHwMFTo/lLWKx2znKgsRdPcK9o1E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043